package com.tr09.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * Servlet implementation class ShangpingListServlet
 */
@WebServlet("/ShangpingListServlet")
public class ShangpingListServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		request.setCharacterEncoding("utf-8");
		int cId = Integer.parseInt(request.getParameter("cId"));
		String cName = request.getParameter("cName");
		int dPrice = Integer.parseInt(request.getParameter("dPrice"));
		int count = Integer.parseInt(request.getParameter("count"));
		HttpSession session = request.getSession();
		session.setAttribute("cId", cId);
		session.setAttribute("cName", cName);
		session.setAttribute("dPrice", dPrice);
		session.setAttribute("count", count);
		String rReceivingaddress = request.getParameter("rReceivingaddress");
		String rName = request.getParameter("rName");
		String rPostCard = request.getParameter("rPostCard");
		String rPhone = request.getParameter("rPhone");
		request.setAttribute("rReceivingaddress", rReceivingaddress);
		request.setAttribute("rName", rName);
		request.setAttribute("rPostCard", rPostCard);
		request.setAttribute("rPhone", rPhone);
		request.getRequestDispatcher("shangpinglist.jsp").forward(request, response);

	}
}
